<template>
    <div>

        <a-select placeholder="请选择菜单类型" allowClear showSearch v-model="selected">
            <a-select-option v-for="(item, index) in WxmpReplyKeyWordOPT" :key="index"
                             :value="item.value">
                {{item.name }}
            </a-select-option>
        </a-select>
    </div>


</template>
<script>
    import {wxmpReplyDict} from '../../../../../../util/internal.api'

    export default {
        props: ['dataSource'],
        data() {
            return {
                selected: undefined,
                WxmpReplyKeyWordOPT: [],
            }
        },
        methods: {
            async init() {
                if (this.dataSource) {
                    this.selected = this.dataSource.replyId;
                }
                wxmpReplyDict().then(res => this.WxmpReplyKeyWordOPT = res);
            }
        },


        created() { this.init();},
        watch: {
            selected(val) {
                this.$emit("callBack", {replyId: val});

            }
        }

    }
</script>
<style scoped>
</style>
